﻿using Mondol.DapperPoco;
using Mondol.DapperPoco.Adapters;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;

namespace FwProject.PublicService.SqlDbContext
{
   public class SqlContextHelp: DbContext
    {
        public string _sqlConnStr = string.Empty;
        public SqlContextHelp(string sqlConnStr) {

            _sqlConnStr = sqlConnStr;
        }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseConnectionString(_sqlConnStr);
            //使用SQL Server数据库
            optionsBuilder.UseSqlAdapter(new SqlServerAdapter(SqlClientFactory.Instance));
        }

    }
}
